home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The X-Philes (2nd Revision)
/
The X-Philes Number 1 (1995).iso
/
xphiles
/
hp48_1
/
egenvalu
< prev
next >
Wrap
Text File
|
1995-03-31
|
2KB
|
71 lines
Article 2295 of comp.sys.handhelds:
Path: en.ecn.purdue.edu!noose.ecn.purdue.edu!samsung!emory!ogicse!orstcs!prism!jacobsd
From: jacobsd@prism.cs.orst.edu (Dana Jacobsen)
Newsgroups: comp.sys.handhelds
Subject: Eigenvalue program
Summary: program to calculate eigenvalues
Keywords: eigenvalues matrix
Message-ID: <jacobsd.658399946@prism>
Date: 12 Nov 90 08:52:26 GMT
Sender: usenet@orstcs.CS.ORST.EDU
Lines: 56
EIGVAL is a program I wrote that calculates eigenvalues. It takes a matrix,
and returns the eigenvalues (n eigenvalues for a n by n matrix). It is not
the most efficient algorithm, but it works. I took the algorithm from the
book "HP28 Step-by-Step Solutions: Vectors and Matrices." Eventually I'll
do an eigenvector program.
Sorry, but I don't have a cable for my 48, so I just typed this in. Maybe
next time.
<<
DUP DUP SIZE 1 GET
-> t g n
<<
{ }
1 n START
0 1 n FOR i
t i DUP
2 ->LIST GET
+
NEXT
1 ->LIST
+ 't' g STO*
NEXT
-> b
<<
{ 1 }
1 n FOR i
-> s
<<
0 1 i FOR j
b j GET
s i j - 1 + GET
* -
NEXT
i /
1 ->LIST s SWAP +
>>
NEXT
>>
>>
PROOT
>>
PROOT is a program that takes a polynomial in a list ( "2*x^2 + 3^x - 2" would
be {2 3 -2}) and returns it's roots. The version I have calls BAIRS repeatedly
until it can factor quadratics. This should be available elsewhere.
--
Dana Jacobsen Oregon State University
jacobsd@cs.orst.edu Computer Science Department
Dana Jacobsen Oregon State University
jacobsd@cs.orst.edu Computer Science
.!hplabs!hp-pcd!orstcs!jacobsd
Dana_Jacobsen@RPITSMTS.BITNET `Once a daemon, always a daemon'